package wiki.kaizen.cloud.plugin.spring.serializer;

import com.alibaba.fastjson.serializer.SerializeWriter;

import java.time.LocalDate;
import java.time.format.DateTimeFormatter;

public class LocalDateSerializer extends AbstractLocalTemporalSerializer {
    @Override
    public void write(SerializeWriter writer, Object object) {
        writer.writeString(
                ((LocalDate)object).format(DateTimeFormatter.ofPattern("yyyy-MM-dd"))
        );
    }
}
